package com.wuhunyu.service;

import com.wuhunyu.commonutils.result.CommonResult;
import com.wuhunyu.entities.EduChapter;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author wuhunyu
 * @since 2021-01-17
 */
public interface EduChapterService extends IService<EduChapter> {

    /**
     * 查询所有章节和小结，并将线性数据转换成树形结构
     * @param courseId
     * @return
     */
    public CommonResult selectChapters(String courseId);

    /**
     * 添加章节
     * @param eduChapter
     * @return
     */
    public CommonResult addChapter(EduChapter eduChapter);

    /**
     * 根据章节id查询章节
     * @param id
     * @return
     */
    public CommonResult selectChapterById(String id);

    /**
     * 修改章节信息
     * @param eduChapter
     * @return
     */
    public CommonResult updateChapter(EduChapter eduChapter);

    /**
     * 当章节下存在小节时，则不能删除
     * @param id
     * @return
     */
    public CommonResult deleteChapterById(String id);

}
